package com.ruoyi.partybuilding.domain;

import java.util.Date;
import java.util.List;

import com.easy.query.core.annotation.EasyWhereCondition;
import com.easy.query.core.annotation.Navigate;
import com.easy.query.core.annotation.Table;
import com.easy.query.core.enums.RelationTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.partybuilding.common.EQuery.IDeptEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.*;

import javax.validation.constraints.*;

/**
 * 班子记录对象 pb_team_record
 * 
 * @author he-liangliang@outlook.com
 * @date 2024-11-27
 */

@ApiModel(value = "班子换届记录",description = "班子换届记录")
@Table("pb_team_record")
@Data
public class TeamRecord extends IDeptEntity.LongId {
    //private static final long serialVersionUID = 1L;



    /** 党组织名称 ; */
    @ApiModelProperty(value = "党组织名称")
    @Excel(name = "党组织名称")
    private String deptName;

    @ApiModelProperty(value = "部门id")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @NotNull(message = "部门id不正确")
    @Min(value = 1,message = "部门id不正确")
    Long deptId;

    /** 届数 ; */
    @NotNull(message = "届数不能为空")
    @Min(value = 1,message = "届数错误")
    @Max(value = 9999,message = "届数错误")
    @ApiModelProperty(value = "届数")
    @Excel(name = "届数")
    private Long year;

    /** 任职年限 ; */
    @ApiModelProperty(value = "任职年限")
    @Excel(name = "年限")
    private Long yearLimit;

    /** 换届时间 ; */
    @ApiModelProperty(value = "换届时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "换届时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date transTime;

    /** 应到人数 ; */
    @ApiModelProperty(value = "应到人数")
    @Excel(name = "应到人数")
    private Long shouldCount;

    /** 实到人数 ; */
    @ApiModelProperty(value = "实到人数")
    @Excel(name = "实到人数")
    private Long realisticCount;

    /** 换届形式，字典team_trans_way ; */
    @ApiModelProperty(value = "换届形式，字典team_trans_way")
    @Excel(name = "换届形式，字典team_trans_way")
    private String way;

    /** 是否沿用 ; */
    @ApiModelProperty(value = "是否沿用0不,1是")
    @Excel(name = "是否沿用")
    private Long iscontinue;

    /** 状态,0当届，1往届 ; */
    @ApiModelProperty(value = "状态,0当届，1往届")
    @Excel(name = "状态,0当届，1往届")
    private Long status;

    @Navigate(value = RelationTypeEnum.OneToMany,targetProperty = "teamId", selfProperty = "id")
    List<TeamPerson> teamPersons;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("deptId", getDeptId())
            .append("deptName", getDeptName())
            .append("year", getYear())
            .append("yearLimit", getYearLimit())
            .append("transTime", getTransTime())
            .append("shouldCount", getShouldCount())
            .append("realisticCount", getRealisticCount())
            .append("way", getWay())
            .append("iscontinue", getIscontinue())
            .append("status", getStatus())
            .toString();
    }
}
